<template>
  <!--数据配置-->
  <div class="box">
    <el-form ref="form" label-width="100px" style="width: 100%">
      <el-form-item label="数据类型：">
        <el-radio v-model="dataType" label="1">静态数据</el-radio><br>
        <el-radio disabled  v-model="dataType" label="2">动态数据</el-radio><br>
        <el-radio disabled  v-model="dataType" label="3">SQL数据</el-radio>
      </el-form-item>
      <el-form-item label="数据值：" v-if="dataType==1">
        <el-button size="mini" @click="$refs.jsonEdit.open(chooseComponent.option.data)">编辑</el-button>
      </el-form-item>
    </el-form>

    <jsonEdit ref="jsonEdit" @ok="jsonEditOk"></jsonEdit>

  </div>
</template>

<script>
  export default {
    name: "dataConfig",
    components: {
      'jsonEdit': () => import('@/components/jsonEdit/index.vue'),
    },
    computed: {
      //当前选中的值
      chooseComponent() {
        return this.$store.state.chooseComponent
      },
    },
    data() {
      return {
        dataType:'1',
      }
    },
    methods:{

      //json编辑确认
      jsonEditOk(obj){
        this.chooseComponent.option.data=obj;
      },
    }
  }
</script>

<style scoped lang="scss">

</style>
